Skip to content

Read a tone's pitch past breaks in its waveform (CHALLENGES 390) - #335

Merged
lana-20 merged 1 commit into
mainfrom
read-pitch-past-breaks
Nov 5, 2026
Merged

lana-20 merged 1 commit into
mainfrom
read-pitch-past-breaks

Conversation

@lana-20

@lana-20 lana-20 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #334.

audio.sh passed 1 of 6 on an Android 15 emulator started by hand: one steady tone was heard as two sounds.

Cause

The issue guessed a dropout. That was wrong: the tone sounds unbroken, and packets were neither late nor short. The waveform has pairs of breaks 33 samples apart, with the tone's phase jumping across them. An FFT across them read 430 Hz for 440, past the 2% that holds one sound together.

The breaks are the emulator's host audio output. The same app and tones gave 151 breaks in 48 s when started by hand, and none from mobium boot, which passes -no-audio. They cluster after audio starts, which is why a loop of captures rarely split and the check usually did.

What changes

  • steadyPitch cuts a window at each break and takes the median of the stretches. Stretches that are not one sound are two notes, read whole as before, so a melody and a real pitch change still split.
  • docs/SETUP.md boots with mobium boot, and says what a hand start costs.
  • -port leaves an emulator with no control port, measured on emulator 37.1.11. SETUP.md said to pass it, and the refusal blamed -no-grpc alone.
  • audio.sh took a tone's first instant for a sound in the pause, failing both versions now and then. A sound inside the pause, and a too-short pause, still fail it.

Measured

audio.sh by hand: main 1 of 6, this 6 of 6. On -no-audio, 4 of 4, and Android 17 passes. audio-sim.sh passes.

Real captures, started by hand:

Level Captures Split on main Split here
-42 dBFS 36 1 0
-46 dBFS 16 2 0
-49 dBFS 16 3 0
-62 dBFS 14 5 2

Not settled here

  • At -62 dBFS, the quietest step that sounds, a tone started by hand still splits 2 in 14: breaks that small go unseen.
  • No tone from anything but MobiumApp was captured: Chrome played nothing. The evidence against the app's module is the boot comparison.
  • Measured on one Mac only, and not on a phone, which captures no samples.

Fixes #334. An emulator started by hand breaks a tone's phase through its host
audio output, 151 breaks in 48 s against none with -no-audio, same app. The FFT
read 430 Hz for 440, which split one sound in two. Not a dropout, as the issue
guessed: the tone is unbroken, and packets were neither late nor short.

Measured by hand: audio.sh main 1 of 6, this 6 of 6. Real captures at -42 to -49
dBFS split 6 of 68 on main and none here; at -62 dBFS, 5 of 14 and 2 of 14.

Also: -port leaves an emulator with no control port, so SETUP.md no longer says to
pass it and the refusal names it. audio.sh took a tone's first instant for a sound
in the pause; a sound inside the pause still fails it.
@lana-20
lana-20 merged commit 0c5274d into main Nov 5, 2026
10 checks passed
@lana-20
lana-20 deleted the read-pitch-past-breaks branch November 5, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

audio.sh fails 2 of 3 runs, on a tone heard as two

1 participant